
@extends("layouts.master")

@section("body")
<div class="row">
	<div class="col-lg-12">                           
        <div class="panel panel-default">                                
			<div class="panel-heading">
				<h2><i class="fa fa-table red"></i><span class="break"></span><strong>订单列表</strong></h2>
				<div class="panel-actions">
					<a class="btn-close"><i class="fa fa-times"></i></a>
				</div>
			</div>
            <div class="col-lg-12">
                <div class="col-lg-2">
                    <select id="status" class="form-control" data-rel="chosen">
                        <option value="">---选择订单状态---</option>
                        @foreach($status as $key => $value)
                        <option value="{{ $key }}"
                        @if(array_key_exists('status',$conditions) && $key == $conditions['status'])
                            selected="selected" 
                        @endif
                        >{{ $value }}</option>
                        @endforeach
                    </select>
                </div>
                <div class="input-group col-lg-2">
                    <input type="text" id="order_id" name="" class="form-control" placeholder="订单号" 
                    @if(array_key_exists('order_id',$conditions))
                        value="{{ $conditions['order_id'] }}" 
                    @endif
                    >
                    <span class="input-group-btn">
                    <button id="search" type="button" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
                    </span>
                </div>
            </div>
            <div class="panel-body">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <style type="text/css">
                                th{
                                    text-align: center;
                                }
                                td{
                                    text-align: center;
                                }
                            </style>

                            <th>
                                #
                            </th>
                            <th>订单编号</th>
                            <th>商品名称</th>
                            <th>购买商品数量</th>
                            <th>商品所消耗积分</th>
                            <th>订单号</th>
							<th>订单状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach($orders as $order)
                        <tr>
                            <td>
                                #
                            </td>
                            <td>{{ $order->id }}</td>
                            <td>{{ $order->c_name }}</td>
                            <td>{{ number_format($order->c_number,0) }}</td>
                            <td>{{ number_format($order->c_integration,0) }}</td>
                            <td>{{ $order->order_id}}</td>
							<td>{{ $order->status_desc}}</td>
                            <td>
                                <a class="btn btn-success" href="/admin/order/details?id={{ $order->id }}">
                                    <i class="fa fa-search-plus "></i>                         
                                </a>
                                <a class="btn btn-info" href="/admin/order/update?id={{ $order->id }}">
                                    <i class="fa fa-edit "></i>                                            
                                </a>
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
                <ul class="pagination">
                   {{ $orders->appends($conditions)->links() }}         
                </ul>
            </div>
        </div>                 
	</div><!--/col-->
</div><!--/row-->
@stop

@section('js')
    <script type="text/javascript" src="/js/js/pages/order/list.js"></script>
@stop

